package cn.xfdzx.android.apps.shop.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.xfdzx.android.apps.shop.R;
import cn.xfdzx.android.apps.shop.bean.GoodsBeen;
import cn.xfdzx.android.apps.shop.contract.GoodActionCallback;
import cn.xfdzx.android.apps.shop.contract.ItemClickListener;
import cn.xfdzx.android.apps.shop.view.MyGridView;

/**
 * @author gzk
 * @date 2020/4/13 0013
 * description：
 */
public class AllCommentAdapter extends RecyclerView.Adapter<AllCommentAdapter.MyViewHolder>{

    private  ItemClickListener mItemClickListener;
    private List<GoodsBeen> list;
    private Context context;


    public void setList(List<GoodsBeen> list) {
        this.list = list;
        notifyDataSetChanged();
    }

    public AllCommentAdapter(Context context, List <GoodsBeen> list) {
        this.list = list;
        this.context = context;
    }

    @NonNull
    @Override
    public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View inflate = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_all_comment, parent, false);
        MyViewHolder myHolder = new MyViewHolder(inflate);

        return myHolder;
    }

    @Override
    public void onBindViewHolder(@NonNull final MyViewHolder holder, final int position) {
//        holder. ivComment.setImageResource(R.drawable.image_avatar_5);
//        holder.tvCommentName.setText(list.get(position).image_id);


    }



    @Override
    public int getItemCount() {
        return 5;
    }

    class MyViewHolder extends RecyclerView.ViewHolder {


        @BindView(R.id.iv_comment)
        ImageView ivComment;
        @BindView(R.id.tv_comment_name)
        TextView tvCommentName;
        @BindView(R.id.tv_comment_time)
        TextView tvCommentTime;
        @BindView(R.id.tv_comment_content)
        TextView tvCommentContent;
        @BindView(R.id.mgv_comment)
        MyGridView mgvComment;
        @BindView(R.id.tv_comment_reply)
        TextView tvCommentReply;
        public MyViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);

        }
    }

    public void setOnItemClickListener( ItemClickListener itemClickListener) {
        this.mItemClickListener = itemClickListener;

    }

}
